class Person:
    def __init__(name,gender,age):
        self._name=name
        self.gender=gender
        self.age=age
        self._is_sleeping=False
    @property
    def name(self):
        return self._name
    def getup(self):
        if self._is_sleeping==False:
            print(f"{self.name}起床了")
        else:
            print(f"{self.name}在睡觉")
    def eat(self,foodname):
        if not self._is_sleeping:
            print(f"{self.name}正在吃{foodname}")
        else:
            print(f"{self.name}在睡觉，不能吃东西")
    def speak(self,content):
        if self._is_sleeping:
            print(f"{self.name}在睡觉，没说话")
        else:
            print(f"他在讲'{content}'")
#if __"name"__==__"main"__:
a=Person(name="黑山老妖",gender="男",age=26)
a.getup()
a.name
a.speak("我饿了")
a.eat("肉")
